package cn.net.zidian.mvvm.adapter;


import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import cn.net.zidian.R;
import cn.net.zidian.bean.AstroBean;

public class AstroAdapter extends BaseQuickAdapter<AstroBean, BaseViewHolder> {
    public AstroAdapter() {
        super(R.layout.item_astro);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, AstroBean item) {
        if (item != null) {
            baseViewHolder.setText(R.id.tv_name, item.getAstroname());
            baseViewHolder.setText(R.id.tv_info, "日期：" + item.getDate());
            ImageView ivImage = baseViewHolder.getView(R.id.iv_image);
            Glide.with(baseViewHolder.itemView)
                    .load(item.getPic())
                    .into(ivImage);
        }
    }
}
